package com.snail.billing.page;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.android.util.ResUtil;
import com.snail.billing.Resource;
import com.snail.billing.os.DialogPage;

public class BoundEmailPage extends DialogPage implements View.OnClickListener {

	private TextView textTitle;
	private View buttonBack;

	private TextView textView;
	private View button;

	@Override
	public int createLayoutId() {
		return ResUtil.getLayoutId(Resource.layout.snailbilling_bound_activity);
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		textTitle = (TextView) findViewById(ResUtil.getViewId(Resource.id.snailbilling_title_text));
		textTitle.setText(ResUtil.getString(Resource.string.snailbilling_bound_email_title));
		buttonBack = findViewById(ResUtil.getViewId(Resource.id.snailbilling_title_button_back));
		buttonBack.setOnClickListener(this);
		//
		textView = (TextView) findViewById(ResUtil.getViewId(Resource.id.snailbilling_bound_text));
		textView.setText(ResUtil.getString(Resource.string.snailbilling_bound_email_text) + getPageArgs().getString("text"));
		button = findViewById(ResUtil.getViewId(Resource.id.snailbilling_bound_button));
		button.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		if (v.equals(buttonBack)) {
			getPageManager().backward();
		} else if (v.equals(button)) {
			getPageManager().forward(BindEmailPage.class);
		}
	}

}
